//
//  main.m
//  oc_19
//
//  Created by 楼楚 on 15/9/15.
//  Copyright (c) 2015年 Chu Lou. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Person.h"
#import "Dog.h"

int main(int argc, const char * argv[]) {
//    @autoreleasepool {
//       
//        
//        
//        
////        code
//        
//        
//        
//        
//    }
    
    NSAutoreleasePool *pool=[[NSAutoreleasePool alloc]init];
    Dog  *dog = [[[Dog alloc]init] autorelease];
    dog.ID = 1;
    NSLog(@"r 1 = %ld",[dog retainCount]);
    Person *p = [[[Person alloc]init] autorelease];
//    [p setDog:dog];
    p.dog = dog;
    NSLog(@"r 2 = %ld",[dog retainCount]);

    
    [dog release];
    NSLog(@"r 3 = %ld",[dog retainCount]);

//    [p release];
//    p = nil;
//    [dog release];
//    dog = nil;
//    
    [pool release];
    pool = nil;
    NSLog(@"pool end release");
    
    return 0;
}
